﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LaoLuo.Common.Test
{
    public class Class1 : IComparable<Class1>, IEquatable<Class1>
    {
        public string Name { get; set; }

        public int Value { get; set; }

        public int CompareTo(Class1 other)
        {
            return String.CompareOrdinal(Name, other.Name) + Value.CompareTo(other.Value);
        }

        public bool Equals(Class1 other)
        {
            return Name.EqualsOrdinal(other.Name) && Value.Equals(other.Value);
        }

        public override bool Equals(object obj)
        {
            return this.Equals(obj as Class1);
        }

        public override int GetHashCode()
        {
            return this.GetHashCode(Name, Value);
        }
    }
}
